import { NgModule } from '@angular/core';

import { Routes, RouterModule } from '@angular/router';
import { SharedModule } from "@shared/shared.module";

import { ListComponent } from './list/list.component';
import { AddComponent } from './add/add.component';
import { EditComponent } from './edit/edit.component';
import { DetailComponent } from './detail/detail.component';

const router: Routes = [
  { path: '', redirectTo: 'list', pathMatch: 'full'},
  { path: 'list', component: ListComponent },
  { path: 'add', component: AddComponent },
  { path: 'edit/:id', component: EditComponent},
  { path: 'detail/:id', component: DetailComponent}
]

@NgModule({
  imports: [
    SharedModule,
    RouterModule.forChild(router)
  ],
  declarations: [ListComponent, AddComponent, EditComponent, DetailComponent]
})
export class NewsModule { }
